<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ include file="/WEB-INF/pages/share/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title>上报信息列表</title>
	
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath+Util.SKIN%>/css/right.css">
	<script src="<%=basePath%>/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="<%=basePath%>/js/oa.js" type="text/javascript"></script>
    <script src="<%=basePath%>/js/dbdialog/lhgdialog.js" type="text/javascript"></script>
	<script src="<%=basePath%>/js/checkbox1.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=basePath%>/js/selected.js"></script>
	<script type="text/javascript" src="<%=basePath%>/js/util.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js" defer="defer"></script>
	<SCRIPT type="text/javascript">
		
		function showDialog(id){
			infoDialog('采纳类型设置','450px','300px', '<%=basePath%>/oa/oaMsg_loadAcceptType.action?id='+id+'&acceptTypeForwardId=1');
		    return false;
		}
		
		$(function(){
			initSelArray('cUnit:1','cDept:1');
			var cGrade = '${cGrade}';
			var cUnit = '${cUnit}';
			var cDept = '${cDept}';
			if(null!=cGrade && cGrade!=""){
				changeGrade(cGrade);
			}
	   		if(cUnit!=null && cUnit!=""){
	   			changeUnit(cUnit);
	   			selected('cUnit',cUnit);	//加载选中部门
	   		}
	   		if(cDept!=null && cDept!=""){
	   			selected('cDept',cDept);	//加载选中单位
	   		}
		});
		function changeGrade(rid){
	   		var urls='<%=basePath%>/oa/oaMsg_loadDept.action?gradeId='+rid
	   		buildSelect(rid, 'cUnit',urls,'1');
	   	}
	   	function changeUnit(uid){
	   		var rid=document.getElementById("cGrade").value;
	   		var urls="<%=basePath%>/oa/oaMsg_loadDept.action?unitId="+uid+"&gradeId="+rid;
	   		buildSelect(uid, 'cDept',urls,'1');
	   	}
	</SCRIPT>
</head>

<body>
	<div class="body-box">
		
		<div class="map">
			<div class="map_con">
				当前位置： 协同办公 &gt; 信息报送 &gt; 列表 
			</div>
		</div>
		<div id="container">		
			<div class="top_search">
			    <fieldset>
				    <legend>查询条件</legend>
						<form action="<%=basePath%>/oa/oaMsg_msgList.action?search=1&menuId=${menuId }" method="post">
							<s:if test="%{menuId == 1}">
					    		<br/>
				    			报送单位：
									<s:select list="gradeList" name="cGrade" listKey="id" listValue="gradeName" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;" id="cGrade" onchange="changeGrade(this.value);"></s:select>
			   						<s:select list="#{}" name="cUnit" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cUnit" onchange="changeUnit(this.value);"></s:select>
			   						<s:select list="#{}" name="cDept" headerKey="" headerValue="请选择" theme="simple" cssStyle="width:155px;margin-left:5px;" id="cDept"></s:select><br/>
				    		</s:if>
				    		报送时间：<input name="beginDate" id="time1" class="Wdate" type="text" value="${beginDate }" readonly="readonly" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')}'})"/>--<input name="endDate" id="time2" class="Wdate" readonly="readonly" type="text" value="${endDate }" onClick="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}'})"/>
				    		采纳类型：&nbsp;&nbsp;<s:select list="acceptType" name="searchType" cssStyle="width:155" value="%{#request.searchType}" listKey="typeName" listValue="typeName" headerKey="" headerValue=" -请选择- " theme="simple"></s:select>
				    		<br/>
				    		标   题：<input style="margin-left: 25px; width: 280px;" type="text" name="key" value="${key}">
				    		<s:if test="%{menuId == 1}">
					    		<br/>
				    			是否已读：<input type="radio" name="readStatus" checked="checked" value="2"/>全部&nbsp;&nbsp;&nbsp;
				    			<input type="radio" name="readStatus" value="1" />已读&nbsp;&nbsp;&nbsp;
				    			<input type="radio" name="readStatus" value="0" />未读
				    		</s:if>
				    		<input type="submit" value=" 搜 索 " class="link_input" name="btnsx">
						</form>
				</fieldset>
			</div>
	<%--<form action="<%=basePath%>/admin/stuff/stuff_delete.action" method="post">--%>
			<table border="0" cellpadding="0" cellspacing="0" class="mytable">
				<tr class="fixedHeaderTr">
					<th width="4%">序号</th>
					<s:if test="%{menuId == 1}">
						<th width="4%">选择</th>
					</s:if>
					<th width="12%">标题</th>
					<th width="8%">报送时间</th>
					<th width="6%">报送人</th>
					<th width="11%">采纳类型</th>
					<s:if test="%{menuId == 1}">
						<th width="10%">上报单位</th>
						<th width="10%">上报部门</th>
					</s:if>
					<th width="10%">操 作</th>
				</tr>
				<s:if test="%{msgList.size>0}">
					<s:iterator id="obj" value="msgList" status="x">
						<tr>
							<td align="center">
								${x.index+1+(page.num-1)*page.size}
							</td>
							<s:if test="%{menuId == 1}">
								<td align="center"><input type="checkbox" name="ids" value="${obj[0]}"></td>
							</s:if>
							<td align="center">
								<a href="<%=basePath%>/oa/oaMsg_loadMsg.action?searchType=${searchType }&key=${key}&num=${num}&size=${size}&beginDate=${beginDate }&endDate=${endDate }&cGrade=${cGrade }&cDept=${cDept }&cUnit=${cUnit }&acceptTypeForwardId=${acceptTypeForwardId }&menuId=${menuId }&result=msg_info&id=${obj[0] }">${obj[1]}&nbsp;</a>
							</td>
							<td align="center">
								<s:date name="%{#obj[3]}" format="yyyy-MM-dd"/>
							</td>
							<td align="center">
								${obj[15]}&nbsp;
							</td>
							<td align="center" id="acceptType${obj[0]}">
								<s:if test="%{#obj.acceptStatus} == 0">
									未采纳
								</s:if>
								<s:else>
									${obj[12]}&nbsp;
								</s:else>
							</td>
							<s:if test="%{menuId == 1}">
								<td align="center">
									${obj[16]}&nbsp;
								</td>
								<td align="center">
									${obj[14]}&nbsp;
								</td>
								<td align="center">
										<a href="#" onclick="return showDialog('${obj[0]}');" id="btn${obj[0] }"><img src="<%=basePath%>/images/Look.gif"/>设置采纳类型</a> 
										<!--<s:if test="%{#obj[9] == '0'}">
										</s:if>-->
										<a href="<%=basePath%>/oa/oaMsg_loadMsg.action?id=${obj[0]}&searchType=${searchType }&key=${key}&num=${num}&size=${size}&beginDate=${beginDate }&endDate=${endDate }&readStatus=${readStatus }&cGrade=${cGrade }&cDept=${cDept }&cUnit=${cUnit }&acceptTypeForwardId=${acceptTypeForwardId }&menuId=${menuId }&result=msg_edit"><img src="<%=basePath%>/images/Update.gif"/>修改</a>
								</td>
							</s:if>
							<s:else>
							<td align="center">
								<a href="<%=basePath%>/oa/oaMsg_loadMsg.action?id=${obj[0]}&searchType=${searchType }&key=${key}&num=${num}&size=${size}&beginDate=${beginDate }&endDate=${endDate }&readStatus=${readStatus }&cGrade=${cGrade }&cDept=${cDept }&cUnit=${cUnit }&acceptTypeForwardId=${acceptTypeForwardId }&menuId=${menuId }&result=msg_edit"><img src="<%=basePath%>/images/Update.gif"/>修改</a>
							</td>
							</s:else>
						</tr>
					</s:iterator>
				</s:if>
				<s:else>
					<tr>
						<td colspan="5" align="center">没有数据</td>
					</tr>
				</s:else>
					<s:if test="%{menuId == 0}">
					<tr>
						<td colspan="5" align="left">
								<input type="button" name="btnlr" value=" 录 入 " class="link_input" onclick="javaScript:document.URL='<%=basePath%>/oa/oaMsg_loadAdd.action?key=${key}&num=${num}&size=${size}&beginDate=${beginDate }&endDate=${endDate }&readStatus=${readStatus }&cGrade=${cGrade }&cDept=${cDept }&cUnit=${cUnit }&acceptTypeForwardId=${acceptTypeForwardId }&menuId=${menuId }&searchType=${searchType }'">
						</td>
					</tr>
					</s:if>
			</table>
			<div class="page">
				<jsp:include flush="true" page="/WEB-INF/pages/share/fenye.jsp">
					<jsp:param name="url4page" value="/oa/oaMsg_msgList.action?key=${key}&beginDate=${beginDate }&endDate=${endDate }&readStatus=${readStatus }&cGrade=${cGrade }&cDept=${cDept }&cUnit=${cUnit }&acceptTypeForwardId=${acceptTypeForwardId }&menuId=${menuId }"/>
				</jsp:include>
			</div>
		</div>
	</div>
</body>
	<s:if test="%{tip!=null}">
	   <input type="hidden" name="tip" id="tip" value="${tip}">
	   <script type="text/javascript">
	        msgDialog(document.getElementById("tip").value,'succ.png');
	      </script>
	</s:if>
</html>
